from django.shortcuts import render
from configureCenter.models import *
from jinja2 import Template
from django.core import serializers
import  json 
# Create your views here.


def show_other(request):
    Id = request.GET.get("id")
    data = HtmlConfig.objects.get(id=Id)
    temp=Template(data.htmlBody)
    d=json.loads(data.reportData)
    print ('解析',d)

    htmlBody=temp.render({
        
        "data":d
    })
    print ("渲染模板",htmlBody)
    return render(request, 'admin/show_other.html', {
        "htmlName": data.htmlName,
        "htmlBody": htmlBody

    })
